﻿<UserControl x:Class="Arma3BEClient.Grids.PlayersControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid"
             xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>


        <ToolBar Height="30">
            <Button Command="{Binding RefreshCommand, Mode=OneWay}">
                <Image Source="../Icons/refresh.ico" Height="16" Width="16"></Image>
            </Button>
            <Separator></Separator>
            <TextBox Margin="2" Text="{Binding Filter, Mode=TwoWay}" Height="20" MinWidth="150"></TextBox>
            <Button Content="Search" Margin="2" Command="{Binding RefreshCommand, Mode=OneWay}"></Button>
            <Separator></Separator>
            <TextBlock Margin="2" HorizontalAlignment="Right" VerticalAlignment="Center" Text="{Binding PlayerCount, Mode=OneWay, StringFormat=Total: {0}}"></TextBlock>


            <xctk:DropDownButton  Content="Search options">
                <xctk:DropDownButton.DropDownContent>
                    <xctk:CheckListBox ItemsSource="{Binding SearchOptions}" SelectedValue="{Binding SelectedOptions}"></xctk:CheckListBox>
                </xctk:DropDownButton.DropDownContent>
            </xctk:DropDownButton>
        </ToolBar>

        <xcdg:DataGridControl Name="dg"  Grid.Row="1" ItemsSource="{Binding Players,  Mode=OneWay}" 
                              AutoCreateColumns="False" ReadOnly="True" SelectedItem="{Binding SelectedPlayer, Mode=TwoWay}"
                             >
            <xcdg:DataGridControl.ContextMenu>
                <ContextMenu>

                    <MenuItem Header="Ban" Click="BanClick" >
                    </MenuItem>

                    <MenuItem Header="Player Info" Click="PlayerInfo_Click" >
                    </MenuItem>

                </ContextMenu>
            </xcdg:DataGridControl.ContextMenu>

            <xcdg:DataGridControl.View>
                <xcdg:TableflowView FixedColumnCount="0"  UseDefaultHeadersFooters="False" ContainerHeight="20"  >
                    <xcdg:TableView.FixedHeaders>
                        <DataTemplate>
                            <xcdg:ColumnManagerRow />
                        </DataTemplate>
                    </xcdg:TableView.FixedHeaders>
                </xcdg:TableflowView>
            </xcdg:DataGridControl.View>
        </xcdg:DataGridControl>
    </Grid>
</UserControl>
